<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Installing PyQt5 &mdash; PyQt 5.3.2 Reference Guide</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '5.3.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="shortcut icon" href="_static/logo_tn.ico"/>
    <link rel="top" title="PyQt 5.3.2 Reference Guide" href="index.html" />
    <link rel="next" title="Differences Between PyQt4 and PyQt5" href="pyqt4_differences.html" />
    <link rel="prev" title="Potential Incompatibilities with Earlier Versions" href="incompatibilities.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="pyqt4_differences.html" title="Differences Between PyQt4 and PyQt5"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="incompatibilities.html" title="Potential Incompatibilities with Earlier Versions"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">PyQt 5.3.2 Reference Guide</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="installing-pyqt5">
<h1>Installing PyQt5<a class="headerlink" href="#installing-pyqt5" title="Permalink to this headline">¶</a></h1>
<div class="section" id="downloading-sip">
<h2>Downloading SIP<a class="headerlink" href="#downloading-sip" title="Permalink to this headline">¶</a></h2>
<p>SIP must be installed before building and using PyQt5.  You can get the latest
release of the SIP source code from
<a class="reference external" href="http://www.riverbankcomputing.com/software/sip/download">http://www.riverbankcomputing.com/software/sip/download</a>.</p>
<p>The SIP documentation can be found at <a class="reference external" href="http://pyqt.sourceforge.net/Docs/sip4/">http://pyqt.sourceforge.net/Docs/sip4/</a>.</p>
</div>
<div class="section" id="downloading-pyqt5">
<h2>Downloading PyQt5<a class="headerlink" href="#downloading-pyqt5" title="Permalink to this headline">¶</a></h2>
<p>You can get the latest release of the GPL version of the PyQt5 source code from
<a class="reference external" href="http://www.riverbankcomputing.com/software/pyqt/download5">http://www.riverbankcomputing.com/software/pyqt/download5</a>.</p>
<p>If you are using the commercial version of PyQt5 then you should use the
download instructions which were sent to you when you made your purchase.  You
must also download your license file.</p>
</div>
<div class="section" id="configuring-pyqt5">
<h2>Configuring PyQt5<a class="headerlink" href="#configuring-pyqt5" title="Permalink to this headline">¶</a></h2>
<p>After unpacking the source package (either a <tt class="docutils literal"><span class="pre">.tar.gz</span></tt> or a <tt class="docutils literal"><span class="pre">.zip</span></tt> file
depending on your platform) you should then check for any <tt class="file docutils literal"><span class="pre">README</span></tt> files
that relate to your platform.</p>
<p>If you are using the commercial version of PyQt5 then you must copy your
license file to the <tt class="file docutils literal"><span class="pre">sip</span></tt> directory.</p>
<p>You need to make sure your environment variables are set properly for your
development environment.</p>
<p>In order to configure the build of PyQt5 you need to run the
<strong class="program">configure.py</strong> script as follows:</p>
<div class="highlight-python"><div class="highlight"><pre>python configure.py
</pre></div>
</div>
<p>This assumes that the Python interpreter is on your path.  Something like the
following may be appropriate on Windows:</p>
<div class="highlight-python"><div class="highlight"><pre>c:\Python34\python configure.py
</pre></div>
</div>
<p>If you have multiple versions of Python installed then make sure you use the
interpreter for which you wish to build PyQt5 for.</p>
<p>The full set of command line options is:</p>
<dl class="cmdoption">
<dt id="cmdoption-configure.py--assume-shared">
<tt class="descname">--assume-shared</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--assume-shared" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally Qt is checked to see if it has been built as shared libraries.
Some Linux distributions configure their Qt builds to make this check
unreliable.  This option ignores the result of the check and assumes that
Qt has been built as shared libraries.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--bindir">
<tt class="descname">--bindir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--bindir" title="Permalink to this definition">¶</a></dt>
<dd><p>The <strong class="program">pyuic5</strong>, <strong class="program">pyrcc5</strong> and <strong class="program">pylupdate5</strong>
utilities will be installed in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--concatenate">
<tt class="descname">--concatenate</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--concatenate" title="Permalink to this definition">¶</a></dt>
<dd><p>The C++ source files for a Python module will be concatenated.  This
results in significantly reduced compilation times.  Most, but not all,
C++ compilers can handle the large files that result.  See also the
<a class="reference internal" href="#cmdoption-configure.py--concatenate-split"><em class="xref std std-option">--concatenate-split</em></a> option.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--concatenate-split">
<tt class="descname">--concatenate-split</tt><tt class="descclassname"> &lt;N&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--concatenate-split" title="Permalink to this definition">¶</a></dt>
<dd><p>If the <a class="reference internal" href="#cmdoption-configure.py--concatenate"><em class="xref std std-option">--concatenate</em></a> option is used to concatenate the C++ source
files then this option determines how many files are created.  The default
is 1.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--configuration">
<tt class="descname">--configuration</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--configuration" title="Permalink to this definition">¶</a></dt>
<dd><p><tt class="docutils literal"><span class="pre">&lt;FILE&gt;</span></tt> contains the configuration of the PyQt5 build to be used instead
of dynamically introspecting the system and is typically used when
cross-compiling.  See <a class="reference internal" href="#ref-configuration-files"><em>Configuring with Configuration Files</em></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--confirm-license">
<tt class="descname">--confirm-license</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--confirm-license" title="Permalink to this definition">¶</a></dt>
<dd><p>Using this confirms that you accept the terms of the PyQt5 license.  If it
is omitted then you will be asked for confirmation during configuration.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--dbus">
<tt class="descname">--dbus</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--dbus" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="file docutils literal"><span class="pre">dbus-python.h</span></tt> header file of the dbus-python package can be
found in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;/dbus</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--debug">
<tt class="descname">--debug</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--debug" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt5 modules will be built with debugging symbols.  On Windows this
requires that a debug version of Python is installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--designer-plugindir">
<tt class="descname">--designer-plugindir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--designer-plugindir" title="Permalink to this definition">¶</a></dt>
<dd><p>The Python plugin for Qt Designer will be installed in the directory
<tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--destdir">
<tt class="descname">--destdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--destdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt5 Python package will be installed in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.  The
default is the Python installation&#8217;s <tt class="file docutils literal"><span class="pre">site-packages</span></tt> directory.  If
you use this option then the <span class="target" id="index-0"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PYTHONPATH</span></tt> environment variable must
include <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--enable">
<tt class="descname">--enable</tt><tt class="descclassname"> &lt;MODULE&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--enable" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally all PyQt5 modules are enabled and are built if the corresponding
Qt library can be found.  Using this option only those modules specifically
enabled will be checked for and built.  The option may be specified any
number of times.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--help">
<span id="cmdoption-configure.py-h"></span><tt class="descname">--help</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-h</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--help" title="Permalink to this definition">¶</a></dt>
<dd><p>Display a help message.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-designer-plugin">
<tt class="descname">--no-designer-plugin</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-designer-plugin" title="Permalink to this definition">¶</a></dt>
<dd><p>The Qt Designer plugin will not be built.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-docstrings">
<tt class="descname">--no-docstrings</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-docstrings" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt5 modules will not contain automatically generated docstrings.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-qml-plugin">
<tt class="descname">--no-qml-plugin</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-qml-plugin" title="Permalink to this definition">¶</a></dt>
<dd><p>The <strong class="program">qmlscene</strong> plugin will not be built.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-qsci-api">
<tt class="descname">--no-qsci-api</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-qsci-api" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="file docutils literal"><span class="pre">PyQt5.api</span></tt> QScintilla API file is not installed even if
QScintilla does appear to be installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-sip-files">
<tt class="descname">--no-sip-files</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-sip-files" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">.sip</span></tt> files for the PyQt5 modules will not be installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-tools">
<tt class="descname">--no-tools</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-tools" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 5.3.</span></p>
</div>
<p>The <tt class="docutils literal"><span class="pre">pyuic5</span></tt>, <tt class="docutils literal"><span class="pre">pyrcc5</span></tt> and <tt class="docutils literal"><span class="pre">pylupdate5</span></tt> tools will not be built.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-timestamp">
<tt class="descname">--no-timestamp</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-timestamp" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally the header comments of each generated C/C++ source file includes
a timestamp corresponding to when the file was generated.  This option
suppresses the inclusion of the timestamp.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--protected-is-public">
<tt class="descname">--protected-is-public</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--protected-is-public" title="Permalink to this definition">¶</a></dt>
<dd><p>On certain platforms the size of PyQt5 modules can be significantly reduced
by redefining the C++ <tt class="docutils literal"><span class="pre">protected</span></tt> keyword as <tt class="docutils literal"><span class="pre">public</span></tt> during
compilation.  This option enables this behaviour and is the default on
Linux and MacOS/X.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--protected-not-public">
<tt class="descname">--protected-not-public</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--protected-not-public" title="Permalink to this definition">¶</a></dt>
<dd><p>The default redefinition of <tt class="docutils literal"><span class="pre">protected</span></tt> to <tt class="docutils literal"><span class="pre">public</span></tt> during compilation
on Linux and MacOS/X is disabled.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--pyuic5-interpreter">
<tt class="descname">--pyuic5-interpreter</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--pyuic5-interpreter" title="Permalink to this definition">¶</a></dt>
<dd><p><tt class="docutils literal"><span class="pre">&lt;FILE&gt;</span></tt> is the name of the Python interpreter used in the pyuic5
wrapper.  The default is platform dependent.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--qmake">
<tt class="descname">--qmake</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--qmake" title="Permalink to this definition">¶</a></dt>
<dd><p>Qt&#8217;s <strong class="program">qmake</strong> program is used to determine how your Qt installation
is laid out.  Normally <strong class="program">qmake</strong> is found on your <span class="target" id="index-1"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>.
This option can be used to specify a particular instance of
<strong class="program">qmake</strong> to use.  This option is not available on Windows where
<strong class="program">qmake</strong> must be on <span class="target" id="index-2"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--qml-plugindir">
<tt class="descname">--qml-plugindir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--qml-plugindir" title="Permalink to this definition">¶</a></dt>
<dd><p>The Python plugin for <strong class="program">qmlscene</strong> will be installed in the
directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--qsci-api">
<tt class="descname">--qsci-api</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--qsci-api" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="file docutils literal"><span class="pre">PyQt5.api</span></tt> QScintilla API file is installed even if QScintilla
does not appear to be installed.  This option is implied if the
<a class="reference internal" href="#cmdoption-configure.py--qsci-api-destdir"><em class="xref std std-option">--qsci-api-destdir</em></a> option is specified.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--qsci-api-destdir">
<tt class="descname">--qsci-api-destdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--qsci-api-destdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The QScintilla API file will be installed in the <tt class="file docutils literal"><span class="pre">python</span></tt>
subdirectory of the <tt class="file docutils literal"><span class="pre">api</span></tt> subdirectory of the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--sip">
<tt class="descname">--sip</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--sip" title="Permalink to this definition">¶</a></dt>
<dd><p>The <strong class="program">sip</strong> program is used to generate PyQt5&#8217;s C++ source code.
Normally <strong class="program">sip</strong> is found on your <span class="target" id="index-3"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>.  This option can
be used to specify a particular instance of <strong class="program">sip</strong> to use.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--sip-incdir">
<tt class="descname">--sip-incdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--sip-incdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">sip.h</span></tt> header file can be found in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--sipdir">
<tt class="descname">--sipdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--sipdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">.sip</span></tt> files for the PyQt5 modules will be installed in the directory
<tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--spec">
<tt class="descname">--spec</tt><tt class="descclassname"> &lt;SPEC&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--spec" title="Permalink to this definition">¶</a></dt>
<dd><p>The argument <tt class="docutils literal"><span class="pre">-spec</span> <span class="pre">SPEC</span></tt> will be passed to <strong class="program">qmake</strong>.  The
default behaviour is platform specific.  On Windows <strong class="program">configure.py</strong>
will choose the value that is correct for the version of Python that is
being used.  (However if you have built Python yourself then you may need
to explicitly specify <tt class="docutils literal"><span class="pre">&lt;SPEC&gt;</span></tt>.)  On MacOS <strong class="program">configure.py</strong> will
try and avoid <tt class="docutils literal"><span class="pre">macx-xcode</span></tt> if possible.)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--static">
<tt class="descname">--static</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--static" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt5 modules will be built as static libraries.  This is useful when
building a custom interpreter with the PyQt5 modules built in to the
interpreter.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--sysroot">
<tt class="descname">--sysroot</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--sysroot" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 5.3.</span></p>
</div>
<p><tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt> is the name of an optional directory that replaces <tt class="docutils literal"><span class="pre">sys.prefix</span></tt>
in the names of other directories (specifically those specifying where the
various PyQt5 components will be installed and where the Python include and
library directories can be found).  It is typically used when
cross-compiling or when building a static version of PyQt5.  See
<a class="reference internal" href="#ref-configuration-files"><em>Configuring with Configuration Files</em></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--target-py-version">
<tt class="descname">--target-py-version</tt><tt class="descclassname"> &lt;VERSION&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--target-py-version" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 5.3.</span></p>
</div>
<p><tt class="docutils literal"><span class="pre">&lt;VERSION&gt;</span></tt> is the major and minor version (e.g. <tt class="docutils literal"><span class="pre">3.4</span></tt>) of the version
of Python being targetted.  By default the version of Python being used to
run the <strong class="program">configure.py</strong> script is used.  It is typically used when
cross-compiling.  See <a class="reference internal" href="#ref-configuration-files"><em>Configuring with Configuration Files</em></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--trace">
<tt class="descname">--trace</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--trace" title="Permalink to this definition">¶</a></dt>
<dd><p>The generated PyQt5 modules contain additional tracing code that is enabled
using SIP&#8217;s <tt class="xref py py-func docutils literal"><span class="pre">sip.settracemask()</span></tt> function.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--verbose">
<tt class="descname">--verbose</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--verbose" title="Permalink to this definition">¶</a></dt>
<dd><p>Compiler commands and any output issued during configuration is displayed
instead of being suppressed.  Use this if <strong class="program">configure.py</strong> is having
problems to see what exactly is going wrong.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--version">
<tt class="descname">--version</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--version" title="Permalink to this definition">¶</a></dt>
<dd><p>Display the PyQt5 version number.</p>
</dd></dl>

<p>Any remaining command line arguments are expected to be in the form
<tt class="docutils literal"><span class="pre">name=value</span></tt> or <tt class="docutils literal"><span class="pre">name+=value</span></tt>.  Such arguments are added to any
<strong class="program">qmake</strong> <tt class="docutils literal"><span class="pre">.pro</span></tt> file created by <strong class="program">configure.py</strong>.</p>
</div>
<div class="section" id="building-pyqt5">
<h2>Building PyQt5<a class="headerlink" href="#building-pyqt5" title="Permalink to this headline">¶</a></h2>
<p>The next step is to build PyQt5 by running your platform&#8217;s <strong class="program">make</strong>
command.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">make</span>
</pre></div>
</div>
<p>The final step is to install PyQt5 by running the following command:</p>
<div class="highlight-python"><div class="highlight"><pre>make install
</pre></div>
</div>
<p>(Depending on your system you may require root or administrator privileges.)</p>
<p>This will install the various PyQt5 components.</p>
</div>
<div class="section" id="co-existence-with-pyqt4">
<h2>Co-existence with PyQt4<a class="headerlink" href="#co-existence-with-pyqt4" title="Permalink to this headline">¶</a></h2>
<p>PyQt5 can be installed alongside PyQt4 using the same Python interpreter
without any problems so long as they are built with the same version of SIP.</p>
</div>
<div class="section" id="configuring-with-configuration-files">
<span id="ref-configuration-files"></span><h2>Configuring with Configuration Files<a class="headerlink" href="#configuring-with-configuration-files" title="Permalink to this headline">¶</a></h2>
<p>The <strong class="program">configure.py</strong> script normally introspects the Python installation
of the interpreter running it in order to determine the names of the various
files and directories it needs.  This is fine for a native build of PyQt5 but
isn&#8217;t appropriate when cross-compiling.  In this case it is possible to supply
a configuration file, specified using the <a class="reference internal" href="#cmdoption-configure.py--configuration"><em class="xref std std-option">--configuration</em></a> option,
which contains definitions of all the required values.</p>
<p>A configuration file is made up of a number of named sections each of which
contains a number of configuration items.  The format of a configuration file
is as follows:</p>
<ul class="simple">
<li>a section name is a single line with the name enclosed between <tt class="docutils literal"><span class="pre">[</span></tt> and
<tt class="docutils literal"><span class="pre">]</span></tt></li>
<li>a configuration item is a single line containing a name/value pair separated
by <tt class="docutils literal"><span class="pre">=</span></tt></li>
<li>values may be extended to lines immediately following if they are indented by
at least one space</li>
<li>a value may include another value by embedding the name of that value
enclosed between <tt class="docutils literal"><span class="pre">%(</span></tt> and <tt class="docutils literal"><span class="pre">)</span></tt></li>
<li>comments begin with <tt class="docutils literal"><span class="pre">#</span></tt> and continue to the end of the line</li>
<li>blank lines are ignored.</li>
</ul>
<p>Those configuration items that appear before the first section name are
automatically added to all sections.</p>
<p>A configuration file defines a section for each version of Qt that requires a
different configuration.  <strong class="program">configure.py</strong> will choose the most
appropriate section according to the version of Qt you are actually using.  For
example, if a configuration file contains sections for Qt v5.3 and Qt v5.1 and
you are using Qt v5.2.1 then the section for Qt v5.1 will be chosen.</p>
<p><strong class="program">configure.py</strong> provides the following preset values for a
configuration:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">py_major</span></tt></dt>
<dd>is the major version number of the target Python installation.</dd>
<dt><tt class="docutils literal"><span class="pre">py_minor</span></tt></dt>
<dd>is the minor version number of the target Python installation.</dd>
<dt><tt class="docutils literal"><span class="pre">sysroot</span></tt></dt>
<dd>is the name of the system root directory.  This is specified with the
<a class="reference internal" href="#cmdoption-configure.py--sysroot"><em class="xref std std-option">--sysroot</em></a> option.</dd>
</dl>
<p>The following is an example configuration file:</p>
<div class="highlight-python"><div class="highlight"><pre># The target Python installation.
py_platform = linux
py_inc_dir = %(sysroot)/usr/include/python%(py_major).%(py_minor)
py_pylib_dir = %(sysroot)/usr/lib/python%(py_major).%(py_minor)/config
py_pylib_lib = python%(py_major).%(py_minor)mu

# The target PyQt installation.
pyqt_module_dir = %(sysroot)/usr/lib/python%(py_major)/dist-packages
pyqt_bin_dir = %(sysroot)/usr/bin
pyqt_sip_dir = %(sysroot)/usr/share/sip/PyQt5
pyuic_interpreter = /usr/bin/python%(py_major).%(py_minor)
pyqt_disabled_features = PyQt_Desktop_OpenGL PyQt_qreal_double

# Qt configuration common to all versions.
qt_shared = True

[Qt 5.1]
pyqt_modules = QtCore QtDBus QtDesigner QtGui QtHelp QtMultimedia
    QtMultimediaWidgets QtNetwork QtOpenGL QtPrintSupport QtQml QtQuick
    QtSensors QtSerialPort QtSql QtSvg QtTest QtWebKit QtWebKitWidgets
    QtWidgets QtXmlPatterns _QOpenGLFunctions_ES2
</pre></div>
</div>
<p>This example contains a section for Qt v5.1.  We have defined a number of
values before the start of the section as they are not specific to any
particular version of Qt.  Note that if you use this configuration with a
version of Qt earlier than v5.1 then you will get an error.</p>
<p>The following values can be specified in the configuration file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">qt_shared</span></tt></dt>
<dd>is set if Qt has been built as shared libraries.  The default value is
<tt class="docutils literal"><span class="pre">False</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">py_platform</span></tt></dt>
<dd>is the target Python platform.</dd>
<dt><tt class="docutils literal"><span class="pre">py_inc_dir</span></tt></dt>
<dd>is the target Python include directory, i.e. the directory containing the
<tt class="docutils literal"><span class="pre">Python.h</span></tt> file.</dd>
<dt><tt class="docutils literal"><span class="pre">py_pylib_dir</span></tt></dt>
<dd>is the target Python library directory.</dd>
<dt><tt class="docutils literal"><span class="pre">py_pylib_lib</span></tt></dt>
<dd>is the target Python interpreter library.  It should not include any
platform-specific prefix or suffix.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_disabled_features</span></tt></dt>
<dd>is the space separated list of features (as defined by SIP&#8217;s <tt class="docutils literal"><span class="pre">%Feature</span></tt>
directive) that should be disabled.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_module_dir</span></tt></dt>
<dd>is the target directory where the PyQt5 modules will be installed.  It can
be overridden by the <a class="reference internal" href="#cmdoption-configure.py--destdir"><em class="xref std std-option">--destdir</em></a> option.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_modules</span></tt></dt>
<dd>is the space separated list of PyQt5 modules that will be built.  It can be
overridden by the <a class="reference internal" href="#cmdoption-configure.py--enable"><em class="xref std std-option">--enable</em></a> option.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_bin_dir</span></tt></dt>
<dd>is the name of the target directory where the PyQt5 related executables
will be installed.  It can be overridden by the <a class="reference internal" href="#cmdoption-configure.py--bindir"><em class="xref std std-option">--bindir</em></a> option.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_sip_dir</span></tt></dt>
<dd>is the name of the target directory where the PyQt5 <tt class="docutils literal"><span class="pre">.sip</span></tt> files will be
installed.  It can be overridden by the <a class="reference internal" href="#cmdoption-configure.py--sipdir"><em class="xref std std-option">--sipdir</em></a> option.</dd>
<dt><tt class="docutils literal"><span class="pre">pyuic_interpreter</span></tt></dt>
<dd>is the name of the Python interpreter (as it would be called from the
target system) that will be used to run <strong class="program">pyuic5</strong>.  It can be
overridden by the <a class="reference internal" href="#cmdoption-configure.py--pyuic5-interpreter"><em class="xref std std-option">--pyuic5-interpreter</em></a> option.</dd>
</dl>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="index.html">
              <img class="logo" src="_static/logo.png" alt="Logo"/>
            </a></p>
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Installing PyQt5</a><ul>
<li><a class="reference internal" href="#downloading-sip">Downloading SIP</a></li>
<li><a class="reference internal" href="#downloading-pyqt5">Downloading PyQt5</a></li>
<li><a class="reference internal" href="#configuring-pyqt5">Configuring PyQt5</a></li>
<li><a class="reference internal" href="#building-pyqt5">Building PyQt5</a></li>
<li><a class="reference internal" href="#co-existence-with-pyqt4">Co-existence with PyQt4</a></li>
<li><a class="reference internal" href="#configuring-with-configuration-files">Configuring with Configuration Files</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="incompatibilities.html"
                        title="previous chapter">Potential Incompatibilities with Earlier Versions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="pyqt4_differences.html"
                        title="next chapter">Differences Between PyQt4 and PyQt5</a></p>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="pyqt4_differences.html" title="Differences Between PyQt4 and PyQt5"
             >next</a> |</li>
        <li class="right" >
          <a href="incompatibilities.html" title="Potential Incompatibilities with Earlier Versions"
             >previous</a> |</li>
        <li><a href="index.html">PyQt 5.3.2 Reference Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2014 Riverbank Computing Limited.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
    </div>
  </body>
</html>